import { useTokenStore } from '@/stores/token.js'
import request from '@/utils/request.js'//导入request.js请求工具
//文章分类列表查询
export const studentListService = ()=>{
    // const tokenStore = useTokenStore();
    //在pinia中定义的响应式数据，都不需要.value可以直接使用
    // return request.get('/category',{headers:{'Authorization':tokenStore.token}})
    return request.get('/student/selectlist')
}

//学生添加接口 参数是json
export const studentAddService = (studentData)=>{
    return request.post('/student/add',studentData)
}

//学生修改 参数是json
export const studentUpdateService=(studentData)=>{
    return request.put('/student/updatest',studentData)
}


//学生删除
export const studentDeleteService=(studentId)=>{
    return request.delete(`/student/delete/${studentId}`)
}



//模糊查询 post是请求体 get是拼接在url路径上 把keyword拼接在路径上
export const studentSelectByName=(keyword)=>{
    return request.get('/student/selectbyname',{params:{keyword}})
}